package edu.utsa.cs.vignette.pdf;

import java.util.ArrayList;
import java.util.List;

import org.apache.pdfbox.pdmodel.PDDocument;

public class PDFTester {
	
	public static void main(String[] args) {
		List<String> pdfsToMerge = new ArrayList<String>();
		for (int i=0; i<5; i++) pdfsToMerge.add("C:\\Users\\spivek\\Downloads\\2010_02_24_RoadBatch 59.pdf");
		pdfsToMerge.add("C:\\Users\\spivek\\Downloads\\02_05_2010_OvalBatch 106.pdf");
		try {
			PDF.MergePDFsAndWrite(pdfsToMerge.toArray(new String[0]),
					"C:\\Users\\spivek\\Downloads\\merged.pdf");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		System.out.println("Merge done.");
		
		try {
			PDDocument isoPage = PDF.extractPage(6, "C:\\Users\\spivek\\Downloads\\merged.pdf");
			isoPage.save("C:\\Users\\spivek\\Downloads\\isopage.pdf");
			isoPage.close();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
